<template>
  <div class="one">
    <el-button @click="arrnum" type="primary">点击遍历数组</el-button>
  </div>
</template>

<script>
export default {
  name: "one",
  data() {
    return {
      arr: [1, 2, 3, 4, 5, 6],
    };
  },
  methods: {
    arrnum() {
      this.arr.some((v,i)=>{
        if(v==3){
          console.log(v);
          return true
        }
      })
      this.arr.every((v, i) => {
        if (i == 2) {
          console.log(v);
          return false;
        } else {
          return true;
        }
      });
    },
  },
};
</script>
